package com.example.demo.Service;

import com.example.demo.Entity.User;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;

public interface UserService {
     User getUserById(long id);

     Optional<User> getUserByName(String name);

     User getUserByEmail(String Email);

     User getUserByPhone(String ph);

     List<User> getUserByRole(String role);

     List<User>  getUserByRegistrationDate(Date RegistrationDate);

     // 创建一个新的 User
     User createUser(User user);

     // 通过 ID 获取 User
     Optional<User> getUserById(Long id);

     // 获取所有的 User
     List<User> getAllUsers();

     // 获取所有的 User
     public Map<String,Object> getAllUsersList();

     // 更新 User
     User updateUser(Long id, User user);

     // 通过 ID 删除 User
     boolean deleteUser(Long id);

     //通过用户名查找用户
     public Map<String,Object> searchLogByUserName(String username);

     //通过用户名禁用用户
     public Map<String,Object> banByUserName(String username);

     //通过用户名激活用户
     public Map<String,Object> activeByUserName(String username);

     Optional<User> findByUsername(String username);



}
